package com.gl.glbooks.util;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

import com.gl.glbooks.vos.IValueObject;

public class IdJsonSerializer extends JsonSerializer<IValueObject> {

	@Override
	public void serialize(IValueObject value, JsonGenerator jgen,
			SerializerProvider spr) throws IOException,
			JsonProcessingException {
		
		Long id = value.getId();
        
        jgen.writeNumber(id); 
	}

}
